class Solution:
    def goodIndices(self, nums: List[int], k: int) -> List[int]:
        n=len(nums)
        lefti=[1]*n
        righti=[1]*n
        for i in range(1,n):
            if nums[i]<=nums[i-1]:
                lefti[i]=lefti[i-1]+1
            if nums[n-i-1]<=nums[n-i]:
                righti[n-i-1]=righti[n-i]+1
        return [i for i in range(k,n-k) if lefti[i-1]>=k and righti[i+1]>=k]/Users/mac/git/haoxiabiao.py